Repository navigation
Enforce contract invariants with clippy.toml, architecture tests, and UI lints - #379
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves standing rules from
docs/agents/contract.mdinto deterministic compile-time, test-time, and workflow checks:clippy.toml+[workspace.lints.clippy] disallowed_methods = "deny"(inherited by all 6 workspace crates) disallowingstd::env::set_current_dirand unapprovedstd::process::exit. Refactorsnative/src/main.rsandhelper/src/main.rsmain()to returnExitCode, and annotates the remaining documented top-level exit points (appd,agentcore,helper::send,windowTauri macro,prototest watchdog).appd/tests/architecture.rsenforcing that core crates (proto,appd,agentcore,helper) never pull in an async runtime (tokio,async-std,smol), every workspace crate inherits[lints] workspace = true, andAGENTS.mdstays compact with valid doc links.window/ui/standin/standin.test.mjsto fail onas any,@ts-ignore,@ts-nocheck, and focused.only(tests inwindow/ui/src.permissions: { contents: read }in.github/workflows/ci.yml.Closes #372.
Evidence
cd window/ui && npm ci && npm run build && npm test: passed (including the new UI hygiene test instandin.test.mjs).cargo fmt --all --check: passed.cargo clippy --workspace --all-targets --locked -- -D warnings: passed (and verified thatdisallowed_methodstriggers across workspace crates when unannotated).cargo test --workspace --locked --no-fail-fast: passed (all workspace crates + 3 new tests inappd/tests/architecture.rs).Merge Danger
Low. No runtime protocol, schema, or UI behavior changed;
nativeandhelpermain()preserve exit codes0/1, and existing top-levelexit(...)calls keep their exact exit semantics.Device decision
No new or changed service commands or fields; paired Device permissions (
ALLOWED_OVER_LAN) are unchanged.